package ${object.javaPackagePath}entity.${object.moduleName};

import java.io.Serializable;
import java.util.Date;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @describe ${object.describe} 
 * @author ${object.author}
 * @version ${object.version}
 * @date ${object.createTime}
 */
@Table(name = "${table.tabelName}")
public class ${table.className} implements Serializable {

	private static final long serialVersionUID = 1L;
	
<#list table.cloums as c>
    <#if c.cnName != "">// ${c.cnName} <#else>// ${c.propertyName} </#if>
    <#list table.pkCloums as pk>
    <#if c.cloumName == pk.cloumName>
    @Id
    @GeneratedValue(generator = "JDBC")
    </#if>
    </#list>
    private ${c.javaType?substring(10)} ${c.propertyName};
</#list>

<#list table.cloums as c>
    <#if c.cnName??>
    /**
     * 获取${c.cnName}属性
     * @return ${c.propertyName}
     */
    </#if>
    public ${c.javaType?substring(10)} get${c.methodName}() {
        return ${c.propertyName};
    }
    
    <#if c.cnName??>
    /**
     * 设置${c.cnName}属性
     * @param ${c.propertyName}
     */
    </#if>
    public void set${c.methodName}(${c.javaType?substring(10)} ${c.propertyName}) {
        <#if c.javaType == "java.lang.String">
        this.${c.propertyName} = ${c.propertyName} == null ? null : ${c.propertyName}.trim();
        <#else>
        this.${c.propertyName} = ${c.propertyName};
        </#if>
    }
</#list>

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append("${table.className}");
        <#list table.cloums as c>
        sb.append("<#if c_index==0>{</#if><#if c_index!=0>, </#if>${c.propertyName}=").append(${c.propertyName});
        </#list>
        sb.append('}');
        return sb.toString();
    }
    
 }
 